﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace SHRIS.MIS.Entity.ScadaData
{
    [Table("tb_deviceStatus")]
    public class DeviceStatusEntity : BaseScadaEnetity
    {
        /// <summary>
        /// 设备状态主键
        /// </summary>
        [Key]
        [Column("DeviceStatusId")]
        public Guid Id { get; set; }

        /// <summary>
        /// 设备编码
        /// </summary>
        [Required]
        public string DeviceCode { get; set; }

        /// <summary>
        /// 当前状态值
        /// </summary>
        [Required]

        public int StatusCode { get; set; }

        /// <summary>
        /// 数据描述,按照标准状态描述的说明字段
        /// </summary>
        [Required]
        public string StatusDescription { get; set; }

        /// <summary>
        /// 0：状态结束  1：状态开始
        /// </summary>
        [Required]
        public int OPType { get; set; }

        /// <summary>
        /// 数值更新时间
        /// </summary>
        [Required]
        public DateTimeOffset OccurTime { get; set; }


        public override string ToString()
        {
            return string.Format("设备：{0} ： {1}==》{2}  {3}", DeviceCode, StatusDescription, OPType.ToString(), OccurTime.ToString());
        }
    }
}
